package com.ballball.matchingsystem.service.impl;

import com.ballball.matchingsystem.service.MatchingService;
import com.ballball.matchingsystem.utils.MatchingPool;
import org.springframework.stereotype.Service;

@Service
public class MatchingServiceImpl implements MatchingService {
    public final static MatchingPool matchingPool= new MatchingPool();
    @Override
    public String addPlayer(Integer userId, Integer rating) {
        System.out.println("add player: " + userId + " " + rating);
        matchingPool.addPlayer(userId, rating);
        return "add player success";
    }

    @Override
    public String removePlayer(Integer userId) {
        System.out.println("remove player: " + userId);
        matchingPool.removePlayer(userId);
        return "remove player success";
    }
    
    @Override
    public String addInviteRelation(Integer inviterId, Integer inviteeId) {
        System.out.println("add invite relation: " + inviterId + " -> " + inviteeId);
        matchingPool.addInviteRelation(inviterId, inviteeId);
        return "add invite relation success";
    }
}
